package com.xxxx.server.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.xxxx.server.mapper.SalaryMapper;
import com.xxxx.server.pojo.Employee;
import com.xxxx.server.pojo.EmployeeVo;
import com.xxxx.server.pojo.Salary;
import com.xxxx.server.service.ISalaryService;

import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zhoubin
 */
@Service
public class SalaryServiceImpl extends ServiceImpl<SalaryMapper, Salary> implements ISalaryService {
//    @Resource
//    private SalaryMapper salaryMapper;

    /**
     * 修改员工账套
     * @param salary
     */
    @Resource
    private SalaryMapper salaryMapper;

    @Override
    public Map<String,Object> selectAllEmployee(EmployeeVo employeeVo) {
        //开启分页
        PageHelper.startPage(employeeVo.getCurrentPage(),employeeVo.getSize());
        //查询
        List<Employee> employeesList = salaryMapper.selectAllEmployee();
        //分页查询
        PageInfo<Employee> pageInfo=new PageInfo<>(employeesList);
        Map<String,Object> map = new HashMap<>();
        map.put("data",pageInfo.getList());
        map.put("total",pageInfo.getTotal());
        return map;
    }



}
